﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WMSSystem.YSL.Dto.LoginDto;

namespace WMSSystem.YSL.Dto.JWT
{
    /// <summary>
    /// JWT令牌DTO
    /// </summary>
    public class JwtTokenDto
    {
        /// <summary>
        /// 访问令牌
        /// </summary>
        public string AccessToken { get; set; }

        /// <summary>
        /// 刷新令牌
        /// </summary>
        public string RefreshToken { get; set; }

        /// <summary>
        /// 令牌类型
        /// </summary>
        public string TokenType { get; set; } = "Bearer";

        /// <summary>
        /// 过期时间（秒）
        /// </summary>
        public int ExpiresIn { get; set; }
        
        // 移除循环引用，只包含必要的用户信息
        public UserInfoDto User { get; set; }
    }

    public class UserInfoDto
    {
        public Guid Id { get; set; }
        public string UserName { get; set; }
        public string PhoneNumber { get; set; }
        public string RealName { get; set; }
        public string Email { get; set; }
        public DateTime CreationTime { get; set; }

        public static implicit operator UserInfoDto(LoginResultDto v)
        {
            throw new NotImplementedException();
        }
    }
}
